package pay.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Mapper;
import pay.entity.TemplateEntity;

@Mapper
public interface TemplateMapper extends BaseMapper<TemplateEntity> {

    @Insert("""
                INSERT INTO template(name, content, description, del)
                VALUES (#{name}, #{content}, #{description}, #{del})
            """)
    int insert(TemplateEntity template);

    @Select("SELECT * FROM template WHERE id = #{id} AND del = 0")
    TemplateEntity selectById(int id);
}
